<?php

require_once 'config.php';

class Gallery
{
    /**
     * @todo Implement cp().
     */
    public function cp()
    {
        // Remove the following line when you implement this method.
        throw new RuntimeException('Not yet implemented.');
    }

    /**
     * @todo Implement ls().
     */
    public function ls()
    {
        // Remove the following line when you implement this method.
        throw new RuntimeException('Not yet implemented.');
    }

    /**
     * Create a given directory
     * @return HTTP Response
     * @param string The name of new directory
     */
    public function mkdir($name = NULL)
    {
        if($name):
	  if(substr($name, 0, 1) == '/'):
	    // Using static folder names is forbidden
	    return header('HTTP/1.0 403 Forbidden');
	  else:
	    if(!mkdir('/' . $GALLERYFOLDER . '/' . $name, 0755)):
	      return header('HTTP/1.0 403 Forbidden');
	    endif;
	    return header('HTTP/1.0 200 Ok');
	  endif;
	endif;
	return header('HTTP/1.0 501 Not implemented');
    }

    /**
     * @todo Implement mv().
     */
    public function mv()
    {
        // Remove the following line when you implement this method.
        throw new RuntimeException('Not yet implemented.');
    }

    /**
     * @todo Implement rm().
     */
    public function rm()
    {
        // Remove the following line when you implement this method.
        throw new RuntimeException('Not yet implemented.');
    }
}
?>
